import Axios from 'axios';
const get = (url, params) => {
    // url = '/api/xqlive/' + url;      //本地测试环境
    url = '/api/' + url;     //本地其他环境
    // url = '/xqlive/' + url;     //线上环境
    return new Promise((resolve, reject) => {
        Axios.get(url, params)
        .then(res => {
            resolve(res.data);
        })
        .catch(err => {
            reject(err.data);
        });
    });
};
const post = (url, params, config) => {
    // url = '/api/xqlive/' + url;      //本地测试环境
    url = '/api/' + url;     //本地其他环境
    // url = '/xqlive/' + url;     //线上环境
    return new Promise((resolve, reject) => {
        console.log(params);
        Axios.post(url, params, config)
        .then(res => {
            resolve(res.data);
        })
        .catch(err => {
            reject(err.data);
        });
    });
};
export default { get, post };